﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using WoChu.RfClient.Entity;

namespace WoChu.RfClient.Duty
{
    public class OnShelvesUIRule
    {
        private static OnShelvesUIRule _NewInstance = new OnShelvesUIRule();

        public static OnShelvesUIRule NewInstance
        {
            get
            {
                if (_NewInstance == null)
                {
                    _NewInstance = new OnShelvesUIRule();
                }

                return _NewInstance;
            }
        }

        public LocationGoodsInfo GetLocationGoodsInfo(string barCode)
        {
            try
            {
                LocationGoodsInfo _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IOnShelves>.NewInstance.InvokeWebMethod<LocationGoodsInfo>("GetLocationGoodsInfo", new object[] { barCode});

                return _result;
            }
            catch (Exception ex)
            {
                WoChu.CF.BaseFrame.Util.MessageBoxEx.Show(ex);
            }
            return null;
        }

        public OutPutParams<bool> SetOnShelves(string userID, List<LocationGoodsInfo> lstLocationGoods)
        {
            try
            {
                OutPutParams<bool> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IOnShelves>.NewInstance.InvokeWebMethod<List<LocationGoodsInfo>, OutPutParams<bool>>("SetOnShelves", new object[] { userID }, lstLocationGoods);

                return _result;
            }
            catch (Exception ex)
            {
                WoChu.CF.BaseFrame.Util.MessageBoxEx.Show(ex);
            }
            return null;
        } 
    }
}
